using UnityEngine;
using UnityEngine.Rendering;

namespace SSRP
{
    public class SSRPCore : RenderPipeline
    {
        SSRPCameraRenderer m_Renderer = new SSRPCameraRenderer();
        bool useDynamicBatching, useGPUInstancing;

        public SSRPCore(bool useDynamicBatching, bool useGPUInstancing, bool useSRPBatcher)
        {
            this.useDynamicBatching = useDynamicBatching;
            this.useGPUInstancing = useGPUInstancing;
            GraphicsSettings.useScriptableRenderPipelineBatching = useSRPBatcher;
        }
        
        protected override void Render(ScriptableRenderContext context, Camera[] cameras)
        {
            foreach (Camera camera in cameras)
            {
                m_Renderer.Render(context, camera, useDynamicBatching, useGPUInstancing);
            }
        }
    }
}
